package com.app.biz.controller;

import java.util.List;
import javax.servlet.http.HttpServletResponse;

import com.app.biz.domain.BizZdgypJc;
import com.app.biz.service.IBizZdgypJcService;
import com.app.common.annotation.Log;
import com.app.common.core.controller.BaseController;
import com.app.common.core.domain.AjaxResult;
import com.app.common.core.page.TableDataInfo;
import com.app.common.enums.BusinessType;
import com.app.common.utils.poi.ExcelUtil;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * 重点工业品调度情况监测Controller
 * 
 * @author ruoyi
 * @date 2024-09-09
 */
@RestController
@RequestMapping("/biz/jc")
public class BizZdgypJcController extends BaseController
{
    @Autowired
    private IBizZdgypJcService bizZdgypJcService;

    /**
     * 查询重点工业品调度情况监测列表
     */
    @PreAuthorize("@ss.hasPermi('system:jc:list')")
    @GetMapping("/list")
    public TableDataInfo list(BizZdgypJc bizZdgypJc)
    {
        startPage();
        List<BizZdgypJc> list = bizZdgypJcService.selectBizZdgypJcList(bizZdgypJc);
        return getDataTable(list);
    }

    /**
     * 导出重点工业品调度情况监测列表
     */
    @PreAuthorize("@ss.hasPermi('system:jc:export')")
    @Log(title = "重点工业品调度情况监测", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    public void export(HttpServletResponse response, BizZdgypJc bizZdgypJc)
    {
        List<BizZdgypJc> list = bizZdgypJcService.selectBizZdgypJcList(bizZdgypJc);
        ExcelUtil<BizZdgypJc> util = new ExcelUtil<BizZdgypJc>(BizZdgypJc.class);
        util.exportExcel(response, list, "重点工业品调度情况监测数据");
    }

    /**
     * 获取重点工业品调度情况监测详细信息
     */
    @PreAuthorize("@ss.hasPermi('system:jc:query')")
    @GetMapping(value = "/{baseId}")
    public AjaxResult getInfo(@PathVariable("baseId") String baseId)
    {
        return success(bizZdgypJcService.selectBizZdgypJcByBaseId(baseId));
    }

    /**
     * 新增重点工业品调度情况监测
     */
    @PreAuthorize("@ss.hasPermi('system:jc:add')")
    @Log(title = "重点工业品调度情况监测", businessType = BusinessType.INSERT)
    @PostMapping
    public AjaxResult add(@RequestBody BizZdgypJc bizZdgypJc)
    {
        return toAjax(bizZdgypJcService.insertBizZdgypJc(bizZdgypJc));
    }

    /**
     * 修改重点工业品调度情况监测
     */
    @PreAuthorize("@ss.hasPermi('system:jc:edit')")
    @Log(title = "重点工业品调度情况监测", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody BizZdgypJc bizZdgypJc)
    {
        return toAjax(bizZdgypJcService.updateBizZdgypJc(bizZdgypJc));
    }

    /**
     * 删除重点工业品调度情况监测
     */
    @PreAuthorize("@ss.hasPermi('system:jc:remove')")
    @Log(title = "重点工业品调度情况监测", businessType = BusinessType.DELETE)
	@DeleteMapping("/{baseIds}")
    public AjaxResult remove(@PathVariable String[] baseIds)
    {
        return toAjax(bizZdgypJcService.deleteBizZdgypJcByBaseIds(baseIds));
    }
}
